<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="bean" uri="struts-bean" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="mcfn" uri="mcfn" %>
<%@taglib prefix="fn" uri="jstl-fn" %>

<%@page import="com.mastercard.assets.web.util.to.UserLogin"%><c:set var="AlarmasLength" value="${fn:length(Alarmas)}" />
				<div id="bodyContent">
						<html:form action="/TareasOperation" method="post" styleId="TareasForm">
						<h1><bean:message key="com.mastercard.assets.web.modules.alarmas.index.labels.Alarmas" arg0="${Tarea.nombre}" /></h1>
						<div onclick="location.href='${URLBase}Flujos.do';" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Flujos</div><div style="display: inline; color: black; font-size: 12px;" > > </div>
						<div onclick="document.getElementById('operation').value=18;document.getElementById('TareasForm').submit( );" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Tareas del Flujo (${Tarea.tblFlujo.nombre})</div><div style="display: inline; color: black; font-size: 12px;" > > </div>
						<div style="display: inline; color: black; font-size: 12px;"  >Alarmas de la Tarea (${Tarea.nombre})</div>
						<br/>
						<br/>

						<div style="width: 100%; text-align: right;"><html:image src="images/btnRegresar.gif" style="display: inline;" onclick="document.getElementById('operation').value=18;document.getElementById('TareasForm').submit( );" /></div>
						<br/>
						<html:hidden property="cveFlujo" styleId="cveFlujo" value="${TareasOperationForm.cveFlujo}"  />
						<html:hidden property="cveTarea" styleId="cveTarea"  />
						<html:hidden property="cveAlarma" styleId="cveAlarma" />
						<html:hidden property="operation" styleId="operation" />
						<html:hidden property="page" value="1" />
						</html:form>
						<table style="border: 0px solid red ; width: 100%;" border="0" >
							<tr>
								<td colspan="3" align="right">
									<html:image src="images/btnAdd.gif" onclick="document.getElementById('operation').value=10;document.getElementById('TareasForm').submit( );" />
								</td>
							</tr>
						</table>
						<table class="tabDatos">
<c:choose>
<c:when test="${AlarmasLength gt 0}">
							<thead>
								<tr>
									<th width="15%"><bean:message key="com.mastercard.assets.web.modules.alarmas.index.labels.Alert"/></th>
									<th width="15%"><bean:message key="com.mastercard.assets.web.modules.alarmas.index.labels.Role"/></th>
									<th width="15%"><bean:message key="com.mastercard.assets.web.modules.alarmas.index.labels.Nivel"/></th>
									<th width="15%"><bean:message key="com.mastercard.assets.web.modules.alarmas.index.labels.Tipo"/></th>
									<th width="15%"><bean:message key="com.mastercard.assets.web.modules.alarmas.index.labels.Correo"/></th>
									<th width="15%"><bean:message key="com.mastercard.assets.web.modules.alarmas.index.labels.TipoAlarma"/></th>
									<th width="10%">&nbsp;</th>
								</tr>
							</thead>
<c:forEach items="${Alarmas}" var="alarma" varStatus="alarmaStatus">
							<tr>
								<td>${mcfn:getShortString(alarma.tblAlerta.nombre,24)}</td>
								<td>${mcfn:getShortString(alarma.tblRole.nombre,24)}</td>
								<td><c:if test="${alarma.tblNivel.nombre eq ''}">Todos</c:if><c:if test="${alarma.tblNivel.nombre ne ''}">${mcfn:getShortString(alarma.tblNivel.nombre,24)}</c:if></td>
								<td><c:choose><c:when test="${alarma.tipo eq 1}"><bean:message key="com.mastercard.assets.web.modules.alarmas.add.messages.Tipo.1"/></c:when><c:when test="${alarma.tipo eq 2}"><bean:message key="com.mastercard.assets.web.modules.alarmas.add.messages.Tipo.2"/></c:when><c:when test="${alarma.tipo eq 3}"><bean:message key="com.mastercard.assets.web.modules.alarmas.add.messages.Tipo.3"/></c:when><c:otherwise><bean:message key="com.mastercard.assets.web.modules.alarmas.add.messages.Nivel.0"/></c:otherwise></c:choose></td>
								<td>${mcfn:getShortString(alarma.email,24)}</td>
								<td><c:if test="${alarma.tipoAlarma eq 1}"><bean:message key="com.mastercard.assets.web.modules.alarmas.add.messages.TipoAlarma.1"/></c:if><c:if test="${alarma.tipoAlarma eq 2}"><bean:message key="com.mastercard.assets.web.modules.alarmas.add.messages.TipoAlarma.2"/></c:if></td>
								<td>
									<html:image src="images/btnEliminar.gif" onclick="document.getElementById('operation').value=12;document.getElementById('cveAlarma').value=${alarma.cveFormaAlarma};document.getElementById('TareasForm').submit( );" />
									&nbsp; 
									<html:image style="display:inline;" src="images/btnEdit.gif" onclick="document.getElementById('operation').value=13;document.getElementById('cveAlarma').value=${alarma.cveFormaAlarma};document.getElementById('TareasForm').submit( );" />
								</td>
							</tr>
</c:forEach>
</c:when>
<c:otherwise>
							<tr>
								<td colspan="3">
									<bean:message key="com.mastercard.assets.web.modules.alarmas.index.messages.NoAlarmasExist" arg0="${Tarea.nombre}"/>
								</td>
							</tr>
</c:otherwise>
</c:choose>
						</table>
						



					</div>
					<div id="footContent"></div>
<%
	UserLogin user = ( UserLogin ) request.getSession( ).getAttribute( "UserLogin" ) ;
	user.clearMessageError( ) ;
%>